<template>
  <view class="class_box">
    <view class="title">回收品类</view>
    <view class="class_item">
      <view
        v-for="(item, index) in classdate"
        :key="index"
        @click="selectCategory(item.type)"
        :class="item.type == type ? 'item_icon on' : 'item_icon'"
      >
        <u-image width="126rpx" height="126rpx" :src="item.img"></u-image>
        <view class="name">{{ item.name }}</view>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    classdate: Array,
    type: String,
  },
  methods: {
    selectCategory(type) {
      this.$emit('typeSelected', type);
    },
  },
};
</script>

<style lang="scss" scoped>
 @import '../FormCompontent.css';
</style>